/**
 * Copyright © 2018 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */
package com.eqxiu.iom.msg.dto;

import java.io.Serializable;

/**
 * @author hanweisong
 * @description TODO
 * @date 2018/12/6 08:59
 */
public abstract class Event implements Serializable {

    /**
     * 消息发送方编码（必填）
     */
    protected String producerCode;

    /**
     * 用户行为编码（效果统计编码）（必填）
     */
    protected String eventCode;

    /**
     * 用户ID（行为触发方ID或消息接收方ID）（必填）
     */
    protected String userId;

    /**
     * 触发时间
     */
    protected long timestamp;

    public Event() {}

    public Event(String producerCode, String eventCode, String userId) {
        this.timestamp = System.currentTimeMillis();
        this.producerCode = producerCode;
        this.eventCode = eventCode;
        this.userId = userId;
    }

    public String getProducerCode() {
        return producerCode;
    }

    public void setProducerCode(String producerCode) {
        this.producerCode = producerCode;
    }

    public String getEventCode() {
        return eventCode;
    }

    public void setEventCode(String eventCode) {
        this.eventCode = eventCode;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public long getTimestamp() {
        return timestamp;
    }

    @Override
    public String toString() {
        return "Event{" +
                "producerCode=" + producerCode + ", " +
                "eventCode=" + eventCode + ", " +
                "userId=" + userId + ", " +
                "timestamp=" + timestamp +
                "}";
    }
}
